package com.alibaba.citrus.cr.sales.plan.functions.salesplan.audit;

import com.alibaba.citrus.cr.common.util.SpringContextUtil;
import com.alibaba.citrus.cr.sales.plan.repository.SalesPlanAuditRepository;
import com.alibaba.citrus.cr.sales.plan.sdo.SalesPlanAuditSDO;

import lombok.Getter;
import lombok.Setter;

/**
 * @author yuhailin
 * @description:
 * @date 2021-09-06 19:02
 */
public class SalesPlanAuditEntity {
    @Getter
    @Setter
    private SalesPlanAuditSDO salesPlanAuditSDO;

    private static SalesPlanAuditRepository salesPlanAuditRepository;
    static {
        salesPlanAuditRepository = SpringContextUtil.getBean(SalesPlanAuditRepository.class);
    }

    public static SalesPlanAuditEntity of(SalesPlanAuditSDO sdo) {
        SalesPlanAuditEntity entity = new SalesPlanAuditEntity();
        entity.setSalesPlanAuditSDO(sdo);
        return entity;
    }

    public String save() {
        return salesPlanAuditRepository.save(this.salesPlanAuditSDO);
    }

    public Boolean edit(){
        return salesPlanAuditRepository.edit(this.salesPlanAuditSDO);
    }

}
